/*
 * File:   standard_in_repository_entity.cpp
 * Author: jolo
 *
 * Created on: 11. Oktober 2011, 00:28
 * Lincense: New BSD License (The BSD 2-Clause License)
 */

#include "standard_in_repository_entity.hpp"

#include "repository.hpp"

namespace model
{

    standard_in_repository_entity::standard_in_repository_entity(const string& n,
                                                                 const string& d,
                                                                 repository* r)
    : in_repository_entity(r), name_(n), description_(d)
    {
    }

    standard_in_repository_entity::~standard_in_repository_entity()
    {
    }

    const string standard_in_repository_entity::to_string() const
    {
        stringstream s;
        s << in_repository_entity::to_string() << ": Name: '" << name() 
                << "' Description: '" << description() << "'";
        return s.str();
    }
    
    const string standard_in_repository_entity::short_label() const {
        return name();
    }
    
    string_vector standard_in_repository_entity::field_sequence() const {
        string_vector r;
        r.push_back("Name");
        r.push_back("Description");
        r.push_back("UUID");
        return r;
    }
    
    string_map standard_in_repository_entity::field_values() const {
        string_map r;
        r["Name"] = name();
        r["Description"] = description();
        r["UUID"] = entity::to_string(uuid());
        return r;
    }
}